1. Technical Field
The present invention relates to an image manipulating method using HTML5, the latest version of a home page description language HTML serving as a basis of web applications. More particularly, the present invention relates to a HTML file that causes a browser adapted to canvas elements in HTML perform a process of color conversion of a specified image with specified characteristics and display of the converted image. It is to be noted that, in this specification, the term “browser” is used not only to mean a program implementing a function of a browser but also to mean a computer on which a browser program is run.
A HTML file is interpreted by a browser to enable the browser to display a home page that an author of a HTML file intends to show. Therefore, a HTML file is considered a kind of computer program that is described using HTML language and which causes a browser to perform a process of displaying a specific home page. In this sense, a HTML file described according to the present invention is a computer program and, therefore, the present invention relates to a computer program.
Furthermore, a file conversion method and a file conversion program that automatically convert an Adobe Flash® format SWF file into a HTML file of the present invention are within the scope of the present invention.
2. Background Art
The assignee of the present application owns and operates a social networking service named “Mobage” (TM pending), through which the assignee provides a wide variety of game contents for mobile phones such as “Kaito Royale®.” Many of the game contents are constructed with HTML or SWF files. Specifically, animation in games is created using SWF files. As is well known, in order to execute SWF files to reproduce images as an author intends with a browser on an information terminal, installation of a program for executing SWF files, such as Flash Player®, in the browser of that information terminal is required.
Some of the latest information terminals called smart phones or tablets that are now extremely popular as well as a part of the rest do not have a browser adapted to Flash Player®. Such browsers not adapted to Flash Player® cannot reproduce animation created using SWF files in game contents properly. On the other hand, many of the latest information terminals incompatible with Flash Player® are adapted to HTML5.
Here, one typical animation technique produced using SWF files and used in game contents will be described, assuming full color image data of a game character. The technique includes defining the image data as original image data and changing the colors of the original image data in various manners in response to a game situation where the game character of the original image data appears. In other words, the same original image data appears or is displayed in various game scenes while the colors of the data are changed appropriately.
In a SWF format, in order to facilitate use of the above technique, the characteristics of color conversion of original image data are indicated by two types of parameters, “MultTerm” and “AddTerm.”
“MultTerm” is the parameter for reducing RGB brightness values of all the pixels in original image data at a specified ratio. The reduction rates for the R brightness value, the G brightness value, and the B brightness value are designated as RedMultTerm, GreenMultTerm, and BlueMultTerm, respectively, and can be specified independently of each other.
“AddTerm” is the parameter for adding to or subtracting from the RGB brightness values of all the pixels in the original image data a specified value. The value to be added to or subtracted from the R brightness value, the G brightness value, and the B brightness value are designated as RedAddTerm, GreenAddTerm, and BlueAddTerm, respectively, and can also be specified independently of each other.
When designation of the original image data and the values of the color conversion parameters “MultTerm” and “AddTerm” are described in a SWF file, a program that executes the SWF file interprets the descriptions, creates image data subject to the color conversion of the original image data according to the specified characteristics at high speed, and displays an image according to the converted image data.
The present invention originated as an attempt to provide the high-speed display of original image data according to color conversion achieved using a combination of a SWF file and Flash Player® in an environment combining a browser not adapted to Flash Player® but to HTML5 and a HTML file.
In summary, the above-mentioned color conversion process involves multiplying each of the RGB brightness values of all the pixels of the original image data by a constant value and adding or subtracting a different constant value to or from the product of the multiplication. In order to implement the above process, an experiment was conducted using a method including making a browser perform a process of obtaining each of the RGB brightness values of each pixel in the original image data pixel by pixel, carrying out the above calculation, and updating each pixel of the original image data according to the calculation result using the HTML5 API using a function of a program described by JavaScript in a HTML file.
The experiment was a failure. Since the number of pixels of image data to be processed is extremely large, it took a substantial amount of time to update data of all the pixels in the image data by instructing a browser to operate the pixels from the HTML file according to a function of pixel operation defined by of the HTML5 API. As a result, the time period from reading of the HTML file by the browser to display of the image after color conversion became impermissibly long.